<?php

/**
 * Subclass for performing query and update operations on the 'reply' table.
 *
 *
 *
 * @package lib.model
 */
class ReplyPeer extends BaseReplyPeer
{
    static function countCommentId(){

        //doSelectRSで実装
        $c = new Criteria();

        //選択するカラムに設定をクリア
        $c->clearSelectColumns();

        //必要なカラムえを設定
        $c->addSelectColumn(self::COMMENT_ID);
        $c->addSelectColumn("COUNT(COMMENT_ID)");

        //GROUP BY命令を指定
        $c->addGroupByColumn(self::COMMENT_ID);

        //dbSelectRSで取得し、配列に格納
        $result = array();
        $rs = self::doSelectRS($c);
        $rs->setFetchMode(ResultSet::FETCHMODE_ASSOC);
        while ($rs->next()) {
            $result[] = $rs->getRow();
        }
        return $result;
    }
        //print_r($result);
}
